<template>
  <el-card>
    <el-descriptions class="margin-top" title="所属学院" :column="1" size="mini" direction="vertical" :colon="false">
      <template slot="extra">
        <!-- <el-select filterable v-model="dataForm.stuDepartment" placeholder="请选择您的院系">
          <el-option v-for="item in departmentDict" :label="item.dictLabel" :key="item.id" :value="item.dictLabel"></el-option>
        </el-select> -->
        {{ this.$store.state.user.dept }}
        
      </template>
      
      <el-descriptions-item label="老师人数" :contentStyle="{'text-align': 'center'}">
        {{ depForm.teachers }}
      </el-descriptions-item>
    
      <el-descriptions-item label="学生人数" :contentStyle="{'text-align': 'center'}" >
        {{ depForm.students }}
      </el-descriptions-item>
      
    </el-descriptions>
    <!-- <div>
      <el-table v-loading="dataListLoading" :data="showDataList"  @refreshDataList="getDataList"
        @selection-change="dataListSelectionChangeHandle"  style="width: 100%;">
        <el-table-column prop="noticeTopic" label="公告"  header-align="center" align="left"  
          show-overflow-tooltip>
          <template slot-scope="scope">
            <el-button type="text" size="small" @click="childHandle(scope.row)">{{ scope.row.noticeTopic }}</el-button>
          </template>
        </el-table-column>
        <el-table-column prop="createtime" header-align="center" align="center"
          width="100"></el-table-column> -->
          <!-- fixed="right" -->
      <!-- </el-table> -->
      <!-- <el-pagination :current-page="page" :page-sizes="[10, 20, 50, 100]" :page-size="limit" :total="total"
        layout="total, sizes, prev, pager, next, jumper" @size-change="pageSizeChangeHandle"
        @current-change="pageCurrentChangeHandle">
      </el-pagination> -->
      <!-- 弹窗, 新增 / 修改 -->
      <!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> -->
    <!-- </div> -->
  </el-card>
</template>

<script>
import servicesApi from '@/services/servicesApi'
export default {
  data() {
    return {        
      depForm: {
        department: '',
        students: null,
        teachers: null,
      },
    }
  },
  created() {
    this.getDataList()
  },
  components: {

  },
  methods: {
    getDataList: function() {//初始化页面获取所有公告

      this.dataListLoading = true
      servicesApi.getDepInfo().then(res => {
        // console.log(res.data)
        let code = res.data.code
        let data = res.data.data
        if (code === 200) {
          this.depForm = data
        } else {
        }
        this.dataListLoading = false
      })


    },
  }
}
</script>
